package com.biz.primus.model.coupon.vo.couponType;

import com.biz.primus.base.exception.utils.AssertUtils;
import com.biz.primus.model.coupon.exceptions.CouponTypeExceptionType;
import com.biz.primus.model.coupon.interfaces.IModelValidation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Objects;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.collections4.CollectionUtils;

/**
 * 更新优惠券类型状态Vo
 *
 * @author david-liu
 */
@ApiModel(description = "更新优惠券状态参数实体")
@Getter
@Setter
public class UpdateCouponTypeStatusReqVo implements IModelValidation {

    @ApiModelProperty(value = "couponTypeIds", notes = "优惠券类型ID", required = true)
    private List<Long> couponTypeIds;

    @ApiModelProperty(value = "status", notes = "更新的目标状态", required = true)
    private Boolean status;

    @Override
    public void validate() {
        AssertUtils.isTrue(CollectionUtils.isNotEmpty(couponTypeIds), CouponTypeExceptionType.PARAMETER_ILLEGAL, new Object[]{"优惠券类型ID不能为空"});
        AssertUtils.notNull(Objects.nonNull(status), CouponTypeExceptionType.PARAMETER_ILLEGAL, new Object[]{"更改目标状态不能为空"});
    }
}
